using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class angle : MonoBehaviour
{
    public float x, y, mousespeed;
    [SerializeField] private Transform player;

    void Start()
    {
        player = transform;
    }

    void Update()
    {
        x = Input.GetAxis("Mouse X") * mousespeed * Time.deltaTime;
        y = Input.GetAxis("Mouse Y") * mousespeed * Time.deltaTime;

        player.Rotate(Vector3.up * x);
        player.Rotate(Vector3.left * y);
    }
}
